<a name="preamble"></a><a name="abstract"></a><html><head>
<title>C++ Annotations Version 6.5.0</title>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="black" bgcolor="white">
<hr>
<h1><center>C++ Annotations Version 6.5.0</center></h1>
<h2><center>Frank B. Brokken</center></h2>

<h2><center>Computing Center, University of Groningen <br>Nettelbosje 1,<br>P.O. Box 11044,<br>9700 CA Groningen <br>The Netherlands <br>
        Published at the University of Groningen <br>
        ISBN 90 367 0470 7</center></h2><h2><center>1994 - November 2006</center></h2>

<blockquote><em>
    This document is intended for knowledgeable users of <strong>C</strong> (or any other
language using a <strong>C</strong>-like grammar, like <strong>Perl</strong> or <strong>Java</strong>) who would like
to know more about, or make the transition to, <strong>C++</strong>. This document is the
main textbook for Frank's <strong>C++</strong> programming courses, which are yearly
organized at the University of Groningen. The <strong>C++</strong> Annotations do not cover
all aspects of <strong>C++</strong>, though. In particular, <strong>C++</strong>'s basic grammar, which
is, for all practical purposes, equal to <strong>C</strong>'s grammar, is not covered. For
this part of the <strong>C++</strong> language, the reader should consult other texts,
like a book covering the <strong>C</strong> programming language.
<p>
If you want a <strong>hard-copy version of the C++ Annotations</strong>: printable versions
are
available in postscript, <a name="an1"></a>
pdf and other formats in
    <a name="an2"></a>

        <center>
    <a target=_top href="ftp://ftp.rug.nl/contrib/frank/documents/annotations">ftp://ftp.rug.nl/contrib/frank/documents/annotations</a>,
        </center>
    in files having names starting with <code>cplusplus</code> (A4 paper size). Files
having names starting with `cplusplusus' are intended for the US <em>legal</em>
paper size.
<p>
The latest version of the <strong>C++</strong> Annotations in html-format can be
browsed at:
        <center>
    <a target=_top href="http://www.icce.rug.nl/documents/">http://www.icce.rug.nl/documents/</a>
        </center>
    </em></blockquote>

<h1>Table of Contents</h1>
<dl>
<dt><h2><a href="cplusplus01.html#l1">Chapter 1: Overview of the chapters</a></h2></dt>
<dt><h2><a href="cplusplus02.html#l2">Chapter 2: Introduction</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus02.html#l3">2.1: What's new in the C++ Annotations</a></h3></dt>
<dt><h3><a href="cplusplus02.html#l4">2.2: C++'s history</a></h3></dt>
<dl>
<dt><a href="cplusplus02.html#l5">2.2.1: History of the C++ Annotations</a></dt>
<dt><a href="cplusplus02.html#l6">2.2.2: Compiling a C program using a C++ compiler</a></dt>
<dt><a href="cplusplus02.html#l7">2.2.3: Compiling a C++ program</a></dt>
<dl>
<dt><a href="cplusplus02.html#l8">2.2.3.1: C++ under MS-Windows</a></dt>
<dt><a href="cplusplus02.html#l9">2.2.3.2: Compiling a C++ source text</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus02.html#l10">2.3: C++: advantages and claims</a></h3></dt>
<dt><h3><a href="cplusplus02.html#l11">2.4: What is Object-Oriented Programming?</a></h3></dt>
<dt><h3><a href="cplusplus02.html#l12">2.5: Differences between C and C++</a></h3></dt>
<dl>
<dt><a href="cplusplus02.html#l13">2.5.1: Namespaces</a></dt>
<dt><a href="cplusplus02.html#l14">2.5.2: End-of-line comment</a></dt>
<dt><a href="cplusplus02.html#l15">2.5.3: NULL-pointers vs. 0-pointers</a></dt>
<dt><a href="cplusplus02.html#l16">2.5.4: Strict type checking</a></dt>
<dt><a href="cplusplus02.html#l17">2.5.5: A new syntax for casts</a></dt>
<dl>
<dt><a href="cplusplus02.html#l18">2.5.5.1: The `static_cast'-operator</a></dt>
<dt><a href="cplusplus02.html#l19">2.5.5.2: The `const_cast'-operator</a></dt>
<dt><a href="cplusplus02.html#l20">2.5.5.3: The `reinterpret_cast'-operator</a></dt>
<dt><a href="cplusplus02.html#l21">2.5.5.4: The `dynamic_cast'-operator</a></dt>
</dl>
<dt><a href="cplusplus02.html#l22">2.5.6: The `void' parameter list</a></dt>
<dt><a href="cplusplus02.html#l23">2.5.7: The `#define __cplusplus'</a></dt>
<dt><a href="cplusplus02.html#l24">2.5.8: Using standard C functions</a></dt>
<dt><a href="cplusplus02.html#l25">2.5.9: Header files for both C and C++</a></dt>
<dt><a href="cplusplus02.html#l26">2.5.10: Defining local variables</a></dt>
<dt><a href="cplusplus02.html#l27">2.5.11: Function Overloading</a></dt>
<dt><a href="cplusplus02.html#l28">2.5.12: Default function arguments</a></dt>
<dt><a href="cplusplus02.html#l29">2.5.13: The keyword `typedef'</a></dt>
<dt><a href="cplusplus02.html#l30">2.5.14: Functions as part of a struct</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus03.html#l31">Chapter 3: A first impression of C++</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus03.html#l32">3.1: More extensions to C in C++</a></h3></dt>
<dl>
<dt><a href="cplusplus03.html#l33">3.1.1: The scope resolution operator ::</a></dt>
<dt><a href="cplusplus03.html#l34">3.1.2: `cout', `cin', and `cerr'</a></dt>
<dt><a href="cplusplus03.html#l35">3.1.3: The keyword `const'</a></dt>
<dt><a href="cplusplus03.html#l36">3.1.4: References</a></dt>
</dl>
<dt><h3><a href="cplusplus03.html#l37">3.2: Functions as part of structs</a></h3></dt>
<dt><h3><a href="cplusplus03.html#l38">3.3: Several new data types</a></h3></dt>
<dl>
<dt><a href="cplusplus03.html#l39">3.3.1: The data type `bool'</a></dt>
<dt><a href="cplusplus03.html#l40">3.3.2: The data type `wchar_t'</a></dt>
<dt><a href="cplusplus03.html#l41">3.3.3: The data type `size_t'</a></dt>
</dl>
<dt><h3><a href="cplusplus03.html#l42">3.4: Keywords in C++</a></h3></dt>
<dt><h3><a href="cplusplus03.html#l43">3.5: Data hiding: public, private and class</a></h3></dt>
<dt><h3><a href="cplusplus03.html#l44">3.6: Structs in C vs. structs in C++</a></h3></dt>
<dt><h3><a href="cplusplus03.html#l45">3.7: Namespaces</a></h3></dt>
<dl>
<dt><a href="cplusplus03.html#l46">3.7.1: Defining namespaces</a></dt>
<dl>
<dt><a href="cplusplus03.html#l47">3.7.1.1: Declaring entities in namespaces</a></dt>
<dt><a href="cplusplus03.html#l48">3.7.1.2: A closed namespace</a></dt>
</dl>
<dt><a href="cplusplus03.html#l49">3.7.2: Referring to entities</a></dt>
<dl>
<dt><a href="cplusplus03.html#l50">3.7.2.1: The `using' directive</a></dt>
<dt><a href="cplusplus03.html#l51">3.7.2.2: `Koenig lookup'</a></dt>
</dl>
<dt><a href="cplusplus03.html#l52">3.7.3: The standard namespace</a></dt>
<dt><a href="cplusplus03.html#l53">3.7.4: Nesting namespaces and namespace aliasing</a></dt>
<dl>
<dt><a href="cplusplus03.html#l54">3.7.4.1: Defining entities outside of their namespaces</a></dt>
</dl>
</dl>
</dl>
<dt><h2><a href="cplusplus04.html#l55">Chapter 4: The `string' data type</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus04.html#l56">4.1: Operations on strings</a></h3></dt>
<dt><h3><a href="cplusplus04.html#l57">4.2: Overview of operations on strings</a></h3></dt>
<dl>
<dt><a href="cplusplus04.html#l58">4.2.1: Initializers</a></dt>
<dt><a href="cplusplus04.html#l59">4.2.2: Iterators</a></dt>
<dt><a href="cplusplus04.html#l60">4.2.3: Operators</a></dt>
<dt><a href="cplusplus04.html#l61">4.2.4: Member functions</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus05.html#l62">Chapter 5: The IO-stream Library</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus05.html#l63">5.1: Special header files</a></h3></dt>
<dt><h3><a href="cplusplus05.html#l64">5.2: The foundation: the class `ios_base'</a></h3></dt>
<dt><h3><a href="cplusplus05.html#l65">5.3: Interfacing `streambuf' objects: the class `ios'</a></h3></dt>
<dl>
<dt><a href="cplusplus05.html#l66">5.3.1: Condition states</a></dt>
<dt><a href="cplusplus05.html#l67">5.3.2: Formatting output and input</a></dt>
<dl>
<dt><a href="cplusplus05.html#l68">5.3.2.1: Formatting flags</a></dt>
<dt><a href="cplusplus05.html#l69">5.3.2.2: Format modifying member functions</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus05.html#l70">5.4: Output</a></h3></dt>
<dl>
<dt><a href="cplusplus05.html#l71">5.4.1: Basic output: the class `ostream'</a></dt>
<dl>
<dt><a href="cplusplus05.html#l72">5.4.1.1: Writing to `ostream' objects</a></dt>
<dt><a href="cplusplus05.html#l73">5.4.1.2: `ostream' positioning</a></dt>
<dt><a href="cplusplus05.html#l74">5.4.1.3: `ostream' flushing</a></dt>
</dl>
<dt><a href="cplusplus05.html#l75">5.4.2: Output to files: the class `ofstream'</a></dt>
<dl>
<dt><a href="cplusplus05.html#l76">5.4.2.1: Modes for opening stream objects</a></dt>
</dl>
<dt><a href="cplusplus05.html#l77">5.4.3: Output to memory: the class `ostringstream'</a></dt>
</dl>
<dt><h3><a href="cplusplus05.html#l78">5.5: Input</a></h3></dt>
<dl>
<dt><a href="cplusplus05.html#l79">5.5.1: Basic input: the class `istream'</a></dt>
<dl>
<dt><a href="cplusplus05.html#l80">5.5.1.1: Reading from `istream' objects</a></dt>
<dt><a href="cplusplus05.html#l81">5.5.1.2: `istream' positioning</a></dt>
</dl>
<dt><a href="cplusplus05.html#l82">5.5.2: Input from streams: the class `ifstream'</a></dt>
<dt><a href="cplusplus05.html#l83">5.5.3: Input from memory: the class `istringstream'</a></dt>
</dl>
<dt><h3><a href="cplusplus05.html#l84">5.6: Manipulators</a></h3></dt>
<dt><h3><a href="cplusplus05.html#l85">5.7: The `streambuf' class</a></h3></dt>
<dl>
<dt><a href="cplusplus05.html#l86">5.7.1: Protected `streambuf' members</a></dt>
<dt><a href="cplusplus05.html#l87">5.7.2: The class `filebuf'</a></dt>
</dl>
<dt><h3><a href="cplusplus05.html#l88">5.8: Advanced topics</a></h3></dt>
<dl>
<dt><a href="cplusplus05.html#l89">5.8.1: Copying streams</a></dt>
<dt><a href="cplusplus05.html#l90">5.8.2: Coupling streams</a></dt>
<dt><a href="cplusplus05.html#l91">5.8.3: Redirecting streams</a></dt>
<dt><a href="cplusplus05.html#l92">5.8.4: Reading AND Writing streams</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus06.html#l93">Chapter 6: Classes</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus06.html#l94">6.1: The constructor</a></h3></dt>
<dl>
<dt><a href="cplusplus06.html#l95">6.1.1: A first application</a></dt>
<dt><a href="cplusplus06.html#l96">6.1.2: Constructors: with and  without arguments</a></dt>
<dl>
<dt><a href="cplusplus06.html#l97">6.1.2.1: The order of construction</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus06.html#l98">6.2: Const member functions and const objects</a></h3></dt>
<dl>
<dt><a href="cplusplus06.html#l99">6.2.1: Anonymous objects</a></dt>
<dl>
<dt><a href="cplusplus06.html#l100">6.2.1.1: Subtleties with anonymous objects</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus06.html#l101">6.3: The keyword `inline'</a></h3></dt>
<dl>
<dt><a href="cplusplus06.html#l102">6.3.1: Defining members inline</a></dt>
<dt><a href="cplusplus06.html#l103">6.3.2: When to use inline functions</a></dt>
</dl>
<dt><h3><a href="cplusplus06.html#l104">6.4: Objects inside objects: composition</a></h3></dt>
<dl>
<dt><a href="cplusplus06.html#l105">6.4.1: Composition and const objects: const member initializers</a></dt>
<dt><a href="cplusplus06.html#l106">6.4.2: Composition and reference objects: reference member initializers</a></dt>
</dl>
<dt><h3><a href="cplusplus06.html#l107">6.5: The keyword `mutable'</a></h3></dt>
<dt><h3><a href="cplusplus06.html#l108">6.6: Header file organization</a></h3></dt>
<dl>
<dt><a href="cplusplus06.html#l109">6.6.1: Using namespaces in header files</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus07.html#l110">Chapter 7: Classes and memory allocation</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus07.html#l111">7.1: The operators `new' and `delete'</a></h3></dt>
<dl>
<dt><a href="cplusplus07.html#l112">7.1.1: Allocating arrays</a></dt>
<dt><a href="cplusplus07.html#l113">7.1.2: Deleting arrays</a></dt>
<dt><a href="cplusplus07.html#l114">7.1.3: Enlarging arrays</a></dt>
</dl>
<dt><h3><a href="cplusplus07.html#l115">7.2: The destructor</a></h3></dt>
<dl>
<dt><a href="cplusplus07.html#l116">7.2.1: New and delete and object pointers</a></dt>
<dt><a href="cplusplus07.html#l117">7.2.2: The function set_new_handler()</a></dt>
</dl>
<dt><h3><a href="cplusplus07.html#l118">7.3: The assignment operator</a></h3></dt>
<dl>
<dt><a href="cplusplus07.html#l119">7.3.1: Overloading the assignment operator</a></dt>
<dl>
<dt><a href="cplusplus07.html#l120">7.3.1.1: The member 'operator=()'</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus07.html#l121">7.4: The `this' pointer</a></h3></dt>
<dl>
<dt><a href="cplusplus07.html#l122">7.4.1: Preventing self-destruction using `this'</a></dt>
<dt><a href="cplusplus07.html#l123">7.4.2: Associativity of operators and this</a></dt>
</dl>
<dt><h3><a href="cplusplus07.html#l124">7.5: The copy constructor: initialization vs. assignment</a></h3></dt>
<dl>
<dt><a href="cplusplus07.html#l125">7.5.1: Similarities between the copy constructor and operator=()</a></dt>
<dt><a href="cplusplus07.html#l126">7.5.2: Preventing certain members from being used</a></dt>
</dl>
<dt><h3><a href="cplusplus07.html#l127">7.6: Conclusion</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus08.html#l128">Chapter 8: Exceptions</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus08.html#l129">8.1: Using exceptions: syntax elements</a></h3></dt>
<dt><h3><a href="cplusplus08.html#l130">8.2: An example using exceptions</a></h3></dt>
<dl>
<dt><a href="cplusplus08.html#l131">8.2.1: Anachronisms: `setjmp()' and `longjmp()'</a></dt>
<dt><a href="cplusplus08.html#l132">8.2.2: Exceptions: the preferred alternative</a></dt>
</dl>
<dt><h3><a href="cplusplus08.html#l133">8.3: Throwing exceptions</a></h3></dt>
<dl>
<dt><a href="cplusplus08.html#l134">8.3.1: The empty `throw' statement</a></dt>
</dl>
<dt><h3><a href="cplusplus08.html#l135">8.4: The try block</a></h3></dt>
<dt><h3><a href="cplusplus08.html#l136">8.5: Catching exceptions</a></h3></dt>
<dl>
<dt><a href="cplusplus08.html#l137">8.5.1: The default catcher</a></dt>
</dl>
<dt><h3><a href="cplusplus08.html#l138">8.6: Declaring exception throwers</a></h3></dt>
<dt><h3><a href="cplusplus08.html#l139">8.7: Iostreams and exceptions</a></h3></dt>
<dt><h3><a href="cplusplus08.html#l140">8.8: Exceptions in constructors and destructors</a></h3></dt>
<dt><h3><a href="cplusplus08.html#l141">8.9: Function try blocks</a></h3></dt>
<dt><h3><a href="cplusplus08.html#l142">8.10: Standard Exceptions</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus09.html#l143">Chapter 9: More Operator Overloading</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus09.html#l144">9.1: Overloading `operator[]()'</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l145">9.2: Overloading the insertion and extraction operators</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l146">9.3: Conversion operators</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l147">9.4: The keyword `explicit'</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l148">9.5: Overloading the increment and decrement operators</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l149">9.6: Overloading binary operators</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l150">9.7: Overloading `operator new(size_t)'</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l151">9.8: Overloading `operator delete(void *)'</a></h3></dt>
<dt><h3><a href="cplusplus09.html#l152">9.9: Operators `new[]' and `delete[]'</a></h3></dt>
<dl>
<dt><a href="cplusplus09.html#l153">9.9.1: Overloading `new[]'</a></dt>
<dt><a href="cplusplus09.html#l154">9.9.2: Overloading `delete[]'</a></dt>
<dl>
<dt><a href="cplusplus09.html#l155">9.9.2.1: `delete[](void *)'</a></dt>
<dt><a href="cplusplus09.html#l156">9.9.2.2: `delete[](void *, size_t)'</a></dt>
<dt><a href="cplusplus09.html#l157">9.9.2.3: Alternate forms of overloading operator `delete[]'</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus09.html#l158">9.10: Function Objects</a></h3></dt>
<dl>
<dt><a href="cplusplus09.html#l159">9.10.1: Constructing manipulators</a></dt>
<dl>
<dt><a href="cplusplus09.html#l160">9.10.1.1: Manipulators requiring arguments</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus09.html#l161">9.11: Overloadable operators</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus10.html#l162">Chapter 10: Static data and functions</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus10.html#l163">10.1: Static data</a></h3></dt>
<dl>
<dt><a href="cplusplus10.html#l164">10.1.1: Private static data</a></dt>
<dt><a href="cplusplus10.html#l165">10.1.2: Public static data</a></dt>
<dt><a href="cplusplus10.html#l166">10.1.3: Initializing static const data</a></dt>
</dl>
<dt><h3><a href="cplusplus10.html#l167">10.2: Static member functions</a></h3></dt>
<dl>
<dt><a href="cplusplus10.html#l168">10.2.1: Calling conventions</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus11.html#l169">Chapter 11: Friends</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus11.html#l170">11.1: Friend functions</a></h3></dt>
<dt><h3><a href="cplusplus11.html#l171">11.2: Inline friends</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus12.html#l172">Chapter 12: Abstract Containers</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus12.html#l173">12.1: Notations used in this chapter</a></h3></dt>
<dt><h3><a href="cplusplus12.html#l174">12.2: The `pair' container</a></h3></dt>
<dt><h3><a href="cplusplus12.html#l175">12.3: Sequential Containers</a></h3></dt>
<dl>
<dt><a href="cplusplus12.html#l176">12.3.1: The `vector' container</a></dt>
<dt><a href="cplusplus12.html#l177">12.3.2: The `list' container</a></dt>
<dt><a href="cplusplus12.html#l178">12.3.3: The `queue' container</a></dt>
<dt><a href="cplusplus12.html#l179">12.3.4: The `priority_queue' container</a></dt>
<dt><a href="cplusplus12.html#l180">12.3.5: The `deque' container</a></dt>
<dt><a href="cplusplus12.html#l181">12.3.6: The `map' container</a></dt>
<dt><a href="cplusplus12.html#l182">12.3.7: The `multimap' container</a></dt>
<dt><a href="cplusplus12.html#l183">12.3.8: The `set' container</a></dt>
<dt><a href="cplusplus12.html#l184">12.3.9: The `multiset' container</a></dt>
<dt><a href="cplusplus12.html#l185">12.3.10: The `stack' container</a></dt>
<dt><a href="cplusplus12.html#l186">12.3.11: The `hash_map' and other hashing-based containers</a></dt>
</dl>
<dt><h3><a href="cplusplus12.html#l187">12.4: The `complex' container</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus13.html#l188">Chapter 13: Inheritance</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus13.html#l189">13.1: Related types</a></h3></dt>
<dt><h3><a href="cplusplus13.html#l190">13.2: The constructor of a derived class</a></h3></dt>
<dt><h3><a href="cplusplus13.html#l191">13.3: The destructor of a derived class</a></h3></dt>
<dt><h3><a href="cplusplus13.html#l192">13.4: Redefining member functions</a></h3></dt>
<dt><h3><a href="cplusplus13.html#l193">13.5: Multiple inheritance</a></h3></dt>
<dt><h3><a href="cplusplus13.html#l194">13.6: Public, protected and private derivation</a></h3></dt>
<dt><h3><a href="cplusplus13.html#l195">13.7: Conversions between base classes and derived classes</a></h3></dt>
<dl>
<dt><a href="cplusplus13.html#l196">13.7.1: Conversions in object assignments</a></dt>
<dt><a href="cplusplus13.html#l197">13.7.2: Conversions in pointer assignments</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus14.html#l198">Chapter 14: Polymorphism</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus14.html#l199">14.1: Virtual functions</a></h3></dt>
<dt><h3><a href="cplusplus14.html#l200">14.2: Virtual destructors</a></h3></dt>
<dt><h3><a href="cplusplus14.html#l201">14.3: Pure virtual functions</a></h3></dt>
<dl>
<dt><a href="cplusplus14.html#l202">14.3.1: Implementing pure virtual functions</a></dt>
</dl>
<dt><h3><a href="cplusplus14.html#l203">14.4: Virtual functions in multiple inheritance</a></h3></dt>
<dl>
<dt><a href="cplusplus14.html#l204">14.4.1: Ambiguity in multiple inheritance</a></dt>
<dt><a href="cplusplus14.html#l205">14.4.2: Virtual base classes</a></dt>
<dt><a href="cplusplus14.html#l206">14.4.3: When virtual derivation is not appropriate</a></dt>
</dl>
<dt><h3><a href="cplusplus14.html#l207">14.5: Run-time type identification</a></h3></dt>
<dl>
<dt><a href="cplusplus14.html#l208">14.5.1: The dynamic_cast operator</a></dt>
<dt><a href="cplusplus14.html#l209">14.5.2: The `typeid' operator</a></dt>
</dl>
<dt><h3><a href="cplusplus14.html#l210">14.6: Deriving classes from `streambuf'</a></h3></dt>
<dt><h3><a href="cplusplus14.html#l211">14.7: A polymorphic exception class</a></h3></dt>
<dt><h3><a href="cplusplus14.html#l212">14.8: How polymorphism is implemented</a></h3></dt>
<dt><h3><a href="cplusplus14.html#l213">14.9: Undefined reference to vtable ...</a></h3></dt>
<dt><h3><a href="cplusplus14.html#l214">14.10: Virtual constructors</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus15.html#l215">Chapter 15: Classes having pointers to members</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus15.html#l216">15.1: Pointers to members: an example</a></h3></dt>
<dt><h3><a href="cplusplus15.html#l217">15.2: Defining  pointers to members</a></h3></dt>
<dt><h3><a href="cplusplus15.html#l218">15.3: Using pointers to members</a></h3></dt>
<dt><h3><a href="cplusplus15.html#l219">15.4: Pointers to static members</a></h3></dt>
<dt><h3><a href="cplusplus15.html#l220">15.5: Pointer sizes</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus16.html#l221">Chapter 16: Nested Classes</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus16.html#l222">16.1: Defining nested class members</a></h3></dt>
<dt><h3><a href="cplusplus16.html#l223">16.2: Declaring nested classes</a></h3></dt>
<dt><h3><a href="cplusplus16.html#l224">16.3: Accessing private members in nested classes</a></h3></dt>
<dt><h3><a href="cplusplus16.html#l225">16.4: Nesting enumerations</a></h3></dt>
<dl>
<dt><a href="cplusplus16.html#l226">16.4.1: Empty enumerations</a></dt>
</dl>
<dt><h3><a href="cplusplus16.html#l227">16.5: Revisiting virtual constructors</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus17.html#l228">Chapter 17: The Standard Template Library, generic algorithms</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus17.html#l229">17.1: Predefined function objects</a></h3></dt>
<dl>
<dt><a href="cplusplus17.html#l230">17.1.1: Arithmetic function objects</a></dt>
<dt><a href="cplusplus17.html#l231">17.1.2: Relational function objects</a></dt>
<dt><a href="cplusplus17.html#l232">17.1.3: Logical function objects</a></dt>
<dt><a href="cplusplus17.html#l233">17.1.4: Function adaptors</a></dt>
</dl>
<dt><h3><a href="cplusplus17.html#l234">17.2: Iterators</a></h3></dt>
<dl>
<dt><a href="cplusplus17.html#l235">17.2.1: Insert iterators</a></dt>
<dt><a href="cplusplus17.html#l236">17.2.2: Iterators for `istream' objects</a></dt>
<dt><a href="cplusplus17.html#l237">17.2.3: Iterators for `istreambuf' objects</a></dt>
<dt><a href="cplusplus17.html#l238">17.2.4: Iterators for `ostream' objects</a></dt>
<dl>
<dt><a href="cplusplus17.html#l239">17.2.4.1: Iterators for `ostreambuf' objects</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus17.html#l240">17.3: The class 'auto_ptr'</a></h3></dt>
<dl>
<dt><a href="cplusplus17.html#l241">17.3.1: Defining `auto_ptr' variables</a></dt>
<dt><a href="cplusplus17.html#l242">17.3.2: Pointing to a newly allocated object</a></dt>
<dt><a href="cplusplus17.html#l243">17.3.3: Pointing to another `auto_ptr'</a></dt>
<dt><a href="cplusplus17.html#l244">17.3.4: Creating a plain `auto_ptr'</a></dt>
<dt><a href="cplusplus17.html#l245">17.3.5: Operators and members</a></dt>
<dt><a href="cplusplus17.html#l246">17.3.6: Constructors and pointer data members</a></dt>
</dl>
<dt><h3><a href="cplusplus17.html#l247">17.4: The Generic Algorithms</a></h3></dt>
<dl>
<dt><a href="cplusplus17.html#l248">17.4.1: accumulate()</a></dt>
<dt><a href="cplusplus17.html#l249">17.4.2: adjacent_difference()</a></dt>
<dt><a href="cplusplus17.html#l250">17.4.3: adjacent_find()</a></dt>
<dt><a href="cplusplus17.html#l251">17.4.4: binary_search()</a></dt>
<dt><a href="cplusplus17.html#l252">17.4.5: copy()</a></dt>
<dt><a href="cplusplus17.html#l253">17.4.6: copy_backward()</a></dt>
<dt><a href="cplusplus17.html#l254">17.4.7: count()</a></dt>
<dt><a href="cplusplus17.html#l255">17.4.8: count_if()</a></dt>
<dt><a href="cplusplus17.html#l256">17.4.9: equal()</a></dt>
<dt><a href="cplusplus17.html#l257">17.4.10: equal_range()</a></dt>
<dt><a href="cplusplus17.html#l258">17.4.11: fill()</a></dt>
<dt><a href="cplusplus17.html#l259">17.4.12: fill_n()</a></dt>
<dt><a href="cplusplus17.html#l260">17.4.13: find()</a></dt>
<dt><a href="cplusplus17.html#l261">17.4.14: find_end()</a></dt>
<dt><a href="cplusplus17.html#l262">17.4.15: find_first_of()</a></dt>
<dt><a href="cplusplus17.html#l263">17.4.16: find_if()</a></dt>
<dt><a href="cplusplus17.html#l264">17.4.17: for_each()</a></dt>
<dt><a href="cplusplus17.html#l265">17.4.18: generate()</a></dt>
<dt><a href="cplusplus17.html#l266">17.4.19: generate_n()</a></dt>
<dt><a href="cplusplus17.html#l267">17.4.20: includes()</a></dt>
<dt><a href="cplusplus17.html#l268">17.4.21: inner_product()</a></dt>
<dt><a href="cplusplus17.html#l269">17.4.22: inplace_merge()</a></dt>
<dt><a href="cplusplus17.html#l270">17.4.23: iter_swap()</a></dt>
<dt><a href="cplusplus17.html#l271">17.4.24: lexicographical_compare()</a></dt>
<dt><a href="cplusplus17.html#l272">17.4.25: lower_bound()</a></dt>
<dt><a href="cplusplus17.html#l273">17.4.26: max()</a></dt>
<dt><a href="cplusplus17.html#l274">17.4.27: max_element()</a></dt>
<dt><a href="cplusplus17.html#l275">17.4.28: merge()</a></dt>
<dt><a href="cplusplus17.html#l276">17.4.29: min()</a></dt>
<dt><a href="cplusplus17.html#l277">17.4.30: min_element()</a></dt>
<dt><a href="cplusplus17.html#l278">17.4.31: mismatch()</a></dt>
<dt><a href="cplusplus17.html#l279">17.4.32: next_permutation()</a></dt>
<dt><a href="cplusplus17.html#l280">17.4.33: nth_element()</a></dt>
<dt><a href="cplusplus17.html#l281">17.4.34: partial_sort()</a></dt>
<dt><a href="cplusplus17.html#l282">17.4.35: partial_sort_copy()</a></dt>
<dt><a href="cplusplus17.html#l283">17.4.36: partial_sum()</a></dt>
<dt><a href="cplusplus17.html#l284">17.4.37: partition()</a></dt>
<dt><a href="cplusplus17.html#l285">17.4.38: prev_permutation()</a></dt>
<dt><a href="cplusplus17.html#l286">17.4.39: random_shuffle()</a></dt>
<dt><a href="cplusplus17.html#l287">17.4.40: remove()</a></dt>
<dt><a href="cplusplus17.html#l288">17.4.41: remove_copy()</a></dt>
<dt><a href="cplusplus17.html#l289">17.4.42: remove_copy_if()</a></dt>
<dt><a href="cplusplus17.html#l290">17.4.43: remove_if()</a></dt>
<dt><a href="cplusplus17.html#l291">17.4.44: replace()</a></dt>
<dt><a href="cplusplus17.html#l292">17.4.45: replace_copy()</a></dt>
<dt><a href="cplusplus17.html#l293">17.4.46: replace_copy_if()</a></dt>
<dt><a href="cplusplus17.html#l294">17.4.47: replace_if()</a></dt>
<dt><a href="cplusplus17.html#l295">17.4.48: reverse()</a></dt>
<dt><a href="cplusplus17.html#l296">17.4.49: reverse_copy()</a></dt>
<dt><a href="cplusplus17.html#l297">17.4.50: rotate()</a></dt>
<dt><a href="cplusplus17.html#l298">17.4.51: rotate_copy()</a></dt>
<dt><a href="cplusplus17.html#l299">17.4.52: search()</a></dt>
<dt><a href="cplusplus17.html#l300">17.4.53: search_n()</a></dt>
<dt><a href="cplusplus17.html#l301">17.4.54: set_difference()</a></dt>
<dt><a href="cplusplus17.html#l302">17.4.55: set_intersection()</a></dt>
<dt><a href="cplusplus17.html#l303">17.4.56: set_symmetric_difference()</a></dt>
<dt><a href="cplusplus17.html#l304">17.4.57: set_union()</a></dt>
<dt><a href="cplusplus17.html#l305">17.4.58: sort()</a></dt>
<dt><a href="cplusplus17.html#l306">17.4.59: stable_partition()</a></dt>
<dt><a href="cplusplus17.html#l307">17.4.60: stable_sort()</a></dt>
<dt><a href="cplusplus17.html#l308">17.4.61: swap()</a></dt>
<dt><a href="cplusplus17.html#l309">17.4.62: swap_ranges()</a></dt>
<dt><a href="cplusplus17.html#l310">17.4.63: transform()</a></dt>
<dt><a href="cplusplus17.html#l311">17.4.64: unique()</a></dt>
<dt><a href="cplusplus17.html#l312">17.4.65: unique_copy()</a></dt>
<dt><a href="cplusplus17.html#l313">17.4.66: upper_bound()</a></dt>
<dt><a href="cplusplus17.html#l314">17.4.67: Heap algorithms</a></dt>
<dl>
<dt><a href="cplusplus17.html#l315">17.4.67.1: The `make_heap()' function</a></dt>
<dt><a href="cplusplus17.html#l316">17.4.67.2: The `pop_heap()' function</a></dt>
<dt><a href="cplusplus17.html#l317">17.4.67.3: The `push_heap()' function</a></dt>
<dt><a href="cplusplus17.html#l318">17.4.67.4: The `sort_heap()' function</a></dt>
<dt><a href="cplusplus17.html#l319">17.4.67.5: An example using the heap functions</a></dt>
</dl>
</dl>
</dl>
<dt><h2><a href="cplusplus18.html#l320">Chapter 18: Template functions</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus18.html#l321">18.1: Defining template functions</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l322">18.2: Argument deduction</a></h3></dt>
<dl>
<dt><a href="cplusplus18.html#l323">18.2.1: Lvalue transformations</a></dt>
<dt><a href="cplusplus18.html#l324">18.2.2: Qualification transformations</a></dt>
<dt><a href="cplusplus18.html#l325">18.2.3: Transformation to a base class</a></dt>
<dt><a href="cplusplus18.html#l326">18.2.4: The template parameter deduction algorithm</a></dt>
</dl>
<dt><h3><a href="cplusplus18.html#l327">18.3: Declaring template functions</a></h3></dt>
<dl>
<dt><a href="cplusplus18.html#l328">18.3.1: Instantiation declarations</a></dt>
</dl>
<dt><h3><a href="cplusplus18.html#l329">18.4: Instantiating template functions</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l330">18.5: Using explicit template types</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l331">18.6: Overloading template functions</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l332">18.7: Specializing templates for deviating types</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l333">18.8: The template function selection mechanism</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l334">18.9: Compiling template definitions and instantiations</a></h3></dt>
<dt><h3><a href="cplusplus18.html#l335">18.10: Summary of the template declaration syntax</a></h3></dt>
</dl>
<dt><h2><a href="cplusplus19.html#l336">Chapter 19: Template classes</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus19.html#l337">19.1: Defining template classes</a></h3></dt>
<dl>
<dt><a href="cplusplus19.html#l338">19.1.1: Default template class parameters</a></dt>
<dt><a href="cplusplus19.html#l339">19.1.2: Declaring template classes</a></dt>
<dt><a href="cplusplus19.html#l340">19.1.3: Distinguishing members and types of formal class-types</a></dt>
<dt><a href="cplusplus19.html#l341">19.1.4: Non-type parameters</a></dt>
</dl>
<dt><h3><a href="cplusplus19.html#l342">19.2: Member templates</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l343">19.3: Static data members</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l344">19.4: Specializing template classes for deviating types</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l345">19.5: Partial specializations</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l346">19.6: Instantiating template classes</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l347">19.7: Processing template classes and instantiations</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l348">19.8: Declaring friends</a></h3></dt>
<dl>
<dt><a href="cplusplus19.html#l349">19.8.1: Non-template functions or classes as friends</a></dt>
<dt><a href="cplusplus19.html#l350">19.8.2: Templates instantiated for specific types as friends</a></dt>
<dt><a href="cplusplus19.html#l351">19.8.3: Unbound templates as friends</a></dt>
</dl>
<dt><h3><a href="cplusplus19.html#l352">19.9: Template class derivation</a></h3></dt>
<dl>
<dt><a href="cplusplus19.html#l353">19.9.1: Deriving non-template classes from template classes</a></dt>
<dt><a href="cplusplus19.html#l354">19.9.2: Deriving template classes from template classes</a></dt>
<dt><a href="cplusplus19.html#l355">19.9.3: Deriving template classes from non-template classes</a></dt>
</dl>
<dt><h3><a href="cplusplus19.html#l356">19.10: Template classes and nesting</a></h3></dt>
<dt><h3><a href="cplusplus19.html#l357">19.11: Subtleties with template classes</a></h3></dt>
<dl>
<dt><a href="cplusplus19.html#l358">19.11.1: Type resolution for base class members</a></dt>
<dt><a href="cplusplus19.html#l359">19.11.2: Returning types nested under template classes</a></dt>
</dl>
<dt><h3><a href="cplusplus19.html#l360">19.12: Constructing iterators</a></h3></dt>
<dl>
<dt><a href="cplusplus19.html#l361">19.12.1: Implementing a `RandomAccessIterator'</a></dt>
<dt><a href="cplusplus19.html#l362">19.12.2: Implementing a `reverse_iterator'</a></dt>
</dl>
</dl>
<dt><h2><a href="cplusplus20.html#l363">Chapter 20: Concrete examples of C++</a></h2></dt>
<dl>
<dt><h3><a href="cplusplus20.html#l364">20.1: Using file descriptors with `streambuf' classes</a></h3></dt>
<dl>
<dt><a href="cplusplus20.html#l365">20.1.1: Classes for output operations</a></dt>
<dt><a href="cplusplus20.html#l366">20.1.2: Classes for input operations</a></dt>
<dl>
<dt><a href="cplusplus20.html#l367">20.1.2.1: Using a one-character buffer</a></dt>
<dt><a href="cplusplus20.html#l368">20.1.2.2: Using an n-character buffer</a></dt>
<dt><a href="cplusplus20.html#l369">20.1.2.3: Seeking positions in `streambuf' objects</a></dt>
<dt><a href="cplusplus20.html#l370">20.1.2.4: Multiple `unget()' calls in `streambuf' objects</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus20.html#l371">20.2: Fixed-sized field extraction from istream objects</a></h3></dt>
<dt><h3><a href="cplusplus20.html#l372">20.3: The `fork()' system call</a></h3></dt>
<dl>
<dt><a href="cplusplus20.html#l373">20.3.1: Redirection revisited</a></dt>
<dt><a href="cplusplus20.html#l374">20.3.2: The `Daemon' program</a></dt>
<dt><a href="cplusplus20.html#l375">20.3.3: The class `Pipe'</a></dt>
<dt><a href="cplusplus20.html#l376">20.3.4: The class `ParentSlurp'</a></dt>
<dt><a href="cplusplus20.html#l377">20.3.5: Communicating with multiple children</a></dt>
<dl>
<dt><a href="cplusplus20.html#l378">20.3.5.1: The class `Select'</a></dt>
<dt><a href="cplusplus20.html#l379">20.3.5.2: The class `Monitor'</a></dt>
<dt><a href="cplusplus20.html#l380">20.3.5.3: The class `Child'</a></dt>
</dl>
</dl>
<dt><h3><a href="cplusplus20.html#l381">20.4: Function objects performing bitwise operations</a></h3></dt>
<dt><h3><a href="cplusplus20.html#l382">20.5: Implementing a `reverse_iterator'</a></h3></dt>
<dt><h3><a href="cplusplus20.html#l383">20.6: A text to anything converter</a></h3></dt>
<dt><h3><a href="cplusplus20.html#l384">20.7: Wrappers for STL algorithms</a></h3></dt>
<dl>
<dt><a href="cplusplus20.html#l385">20.7.1: Local context structs</a></dt>
<dt><a href="cplusplus20.html#l386">20.7.2: Member functions called from function objects</a></dt>
<dt><a href="cplusplus20.html#l387">20.7.3: The configurable, single argument function object template</a></dt>
<dt><a href="cplusplus20.html#l388">20.7.4: The configurable, two argument function object template</a></dt>
</dl>
<dt><h3><a href="cplusplus20.html#l389">20.8: Using `bisonc++' and `flex'</a></h3></dt>
<dl>
<dt><a href="cplusplus20.html#l390">20.8.1: Using `flex' to create a scanner</a></dt>
<dl>
<dt><a href="cplusplus20.html#l391">20.8.1.1: The derived class `Scanner'</a></dt>
<dt><a href="cplusplus20.html#l392">20.8.1.2: Implementing `Scanner'</a></dt>
<dt><a href="cplusplus20.html#l393">20.8.1.3: Using a `Scanner' object</a></dt>
<dt><a href="cplusplus20.html#l394">20.8.1.4: Building the program</a></dt>
</dl>
<dt><a href="cplusplus20.html#l395">20.8.2: Using both `bisonc++' and `flex'</a></dt>
<dl>
<dt><a href="cplusplus20.html#l396">20.8.2.1: The `bisonc++' specification file</a></dt>
<dt><a href="cplusplus20.html#l397">20.8.2.2: The `flex' specification file</a></dt>
<dt><a href="cplusplus20.html#l398">20.8.2.3: Generating code</a></dt>
</dl>

<p><hr><p>
<p>

</body>
</html>
